Add Severity filter - #920
Conversation
Adds a severity dropdown next to the existing quick filters, so test
results can be narrowed down to one or more severity levels. Test
results without a `severity` label are selectable as their own option
("no severity"), backed by the `none` sentinel value written to the
tree leaves.
The filter is always visible and its state is kept in the `severity`
url param, in line with the transition filter.
The transition filter rebuilt from the url put `logicalOperator` inside the field instead of on the field filter itself, so `buildFieldFilters` fell back to "AND" and chained the selected transitions with it. Since a test result has exactly one transition, selecting more than one transition matched nothing at all.
02b35ec to
0f976f2
Compare
…-filter # Conflicts: # packages/web-awesome/types.d.ts
# Conflicts: # packages/web-awesome/src/stores/treeFilters/store.ts
vdvukhzhilov
left a comment
There was a problem hiding this comment.
Thank you for the contribution! 🙇
Before we can merge this, could you please:
- Update the branch and resolve any conflicts with latest changes in
main - Rework the handling of tests without an assigned severity
My concern is the introduced noSeverityValue. By default, most test results do not have an assigned severity, so this implementation would write severity: "none" to almost every generated tree leaf.
Since tree data is serialized into report files, this adds unnecessary data, potentially across multiple generated trees, to represent information already expressed by the absence of the optional severity property.
Please keep severity absent when no severity label is assigned, and adjust the filtering implementation so that "No severity" can select leaves where the property is missing, without introducing or serializing a sentinel value such as noSeverityValue.
Thanks again for working on this! 👍
Tree leaves of test results without a severity label no longer carry a "none" placeholder, so nothing extra is serialized into the report files. The "no severity" filter option is translated into a null field filter instead, which matches leaves where the property is absent.
|
@vdvukhzhilov Thanks, good catch! The sentinel is gone.
"No severity" now matches the absence of the property: Tests updated accordingly. |
…-filter # Conflicts: # packages/web-awesome/src/components/ReportFilters/index.tsx # packages/web-awesome/src/stores/treeFilters/constants.ts # packages/web-awesome/src/stores/treeFilters/utils.ts # packages/web-awesome/test/components/ReportFilters.test.tsx # packages/web-awesome/test/stores/treeFilters/store.test.ts # packages/web-awesome/test/stores/treeFilters/utils.test.ts
vdvukhzhilov
left a comment
There was a problem hiding this comment.
Thanks for the update 👍
Verified locally:
- Severity filter is available with all levels +
No severity - Filtering updates the tree and the severity URL param as expected
- Multi-select works as
OR - Leaves only get a severity field when a label is set
LGTM 🎉
Context
Fixes #921
The awesome report could be narrowed down by transition, tags and categories, but not by severity — even though the severity label is already shown on every test result. This adds a severity dropdown next to the existing quick filters.
severitylabel can be filtered for explicitly.OR, and the selection is kept in theseverityurl param, in line with the transition filter.severitylabel to each tree leaf, falling back to the newnoSeverityValue("none") sentinel fromcore-apiwhen the label is absent.filters.severityand theseverity.*level names, so only the newseverity.noneentry had to be translated.While covering the new filter, the same code path turned out to be broken for transitions: the transition filter rebuilt from the url put
logicalOperatorinside the field instead of on the field filter itself, sobuildFieldFiltersfell back toANDand chained the selected transitions with it. Since a test result has exactly one transition, selecting more than one transition matched nothing at all. That is fixed in a separate commit, with a regression test.Checklist